﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
//下面这句一定要加，否则不生效
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]
namespace Common
{
    public class LogHelper
    {
       
        private static log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
        private static log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
        private static log4net.ILog logDebug = log4net.LogManager.GetLogger("logDebug");

        public static void LogInfo(string info)
        {
            if (loginfo.IsInfoEnabled)
            {
                loginfo.Info(info);
            }
        }

        public static void LogError(string info, Exception se)
        {
            if (logerror.IsErrorEnabled)
            {
                logerror.Error(info, se);
            }
        }
        public static void LogDebug(string info)
        {

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("");
            Console.WriteLine(DateTime.Now.ToString()+":");
            Console.WriteLine(info);
            Console.WriteLine("");
            
        }




    }
}
